package com.woorigil.social.controller.api.koreaflower;

import com.woorigil.social.domain.flower.FlowerInfo;
import com.woorigil.social.domain.flower.FlowerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: nicejinux
 * Date: 13. 6. 29.
 * Time: PM 2:23
 * To change this template use File | Settings | File Templates.
 */

@Controller
public class V1_0_FlowerApiController {

    @Autowired
    FlowerInfoService flowerInfoService;

    @RequestMapping("/api/koreaflower/allFlowerList")
    public org.springframework.web.servlet.ModelAndView allFlowerList() {
        List<FlowerInfo> allFlower = flowerInfoService.getAllFlowerInfo();

        ModelAndView mnv = new ModelAndView("");
        mnv.addObject("status", "SUCCESS");
        mnv.addObject("message", "");
        mnv.addObject("allFlowerList", allFlower);

        return mnv;
    }
}
